<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <script type="text/javascript" src="${createLinkTo(dir: 'js/jquery', file: 'jquery-1.3.2.min.js')}"></script>
  <script type="text/javascript" src="${createLinkTo(dir: 'js/jquery', file: 'jquery.jeditable.js')}"></script>
  <link rel="stylesheet" href="${createLinkTo(dir: 'facebox', file: 'facebox.css')}"/>
  <script type="text/javascript" src="${createLinkTo(dir: 'facebox', file: 'facebox.js')}"></script>
  <g:javascript>
$(function() {
            $('a[rel*=facebox]').facebox({
              loading_image : '${createLinkTo(dir: 'facebox', file: 'loading.gif')}',
              close_image   : '${createLinkTo(dir: 'facebox', file: 'closelabel.gif')}'
            });
          })
  </g:javascript>
  <title>Entry List</title>
</head>
<body>
<div class="nav">
  <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}">Home</a></span>
  <span class="menuButton"><g:link class="create" action="create">New Entry</g:link></span>
</div>
<div class="body">
  <h1>Entry List</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <div class="list">
    <table>
      <thead>
      <tr>

        <g:sortableColumn property="id" title="Id"/>

        <th>title</th>

        <g:sortableColumn property="content" title="Content"/>

        <g:sortableColumn property="tagNames" title="Tag Names"/>

        <g:sortableColumn property="stage" title="stage"/>

        <g:sortableColumn property="source" title="Source"/>

        <th>Catalog</th>

      </tr>
      </thead>
      <tbody>
      <g:each in="${entryInstanceList}" status="i" var="entryInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

          <td><g:link action="show" id="${entryInstance.id}">${fieldValue(bean: entryInstance, field: 'id')}</g:link></td>

          <td><a href="/yuying/entry/preview?id=${entryInstance.id}&offset=${params.offset}" rel="facebox">${fieldValue(bean: entryInstance, field: 'title')}</a></td>

          <td><cms:shortContent content="${entryInstance.content}"/></td>

          <td>${fieldValue(bean: entryInstance, field: 'tagNames')}</td>

          <td>${fieldValue(bean: entryInstance, field: 'stage')}</td>

          <td>${fieldValue(bean: entryInstance, field: 'source')}</td>

          <td class="category" id="${entryInstance.id}">${entryInstance.catalog?.name}</td>

        </tr>
      </g:each>
      </tbody>
    </table>
  </div>
  <div class="paginateButtons">
    <g:paginate total="${entryInstanceTotal}"/>
  </div>
</div>
</body>
</html>
